package model;

import java.util.*;

public enum ApartmentStatus
{
	UNDEFINED(0,"undefined"),
	RENTED (1,"Rented"),
	RENOVATION(2, "Under renovation"),
	EMPTY(3,"Empty");
	
	/* FIELDS */
	private final int index;
	private final String value;
	private static final Map<Integer,ApartmentStatus> lookup = new HashMap<Integer,ApartmentStatus>();
	
	/* CONSTRUCTORS */
	private ApartmentStatus(int index, String value) 
	{
        this.index = index;
        this.value = value;
    }
	static 
	{
	    for(ApartmentStatus ct : EnumSet.allOf(ApartmentStatus.class))
	         lookup.put(ct.getIndex(), ct);
	}
	/* ACCESSORS */
	public int getIndex()
	{
		return this.index;
	}
	public String getValue()
	{
		return this.value;
	}
	public static ApartmentStatus getStatus(int index) { 
        return lookup.get(index); 
   }
}
